<html>
	<head>
		<% content_for :title, t("addUser") %>
	</head>
	<body>
		<div class="feat_prod_box_details">
			<div class="contact_form">
				<div class="form_subtitle">
					<%= t :newmanageruser %>
				</div>
				<p>
					<%= notice%>
				</p>
				<!-- <%= form_for @manageruser do |f| %>
				<%= f.file_field :excel_file %> -->

				<form accept-charset="UTF-8" action="/managerusers" class="new_manageruser" enctype="multipart/form-data" id="new_manageruser" method="post" onsubmit= "return checkUploadExelFile()">
					<div style="margin:0;padding:0;display:inline">
						<input name="utf8" type="hidden" value="&#x2713;" />
						<input name="authenticity_token" type="hidden" value="1It/hrcuHp1xOFCCTVi2wB/5QlfyNfuSll1zwrLL9BM=" />
					</div>
					<input id="manageruser_excel_file" name="manageruser[excel_file]" type="file" />

					<br/>
					<div class="form_row" >
						<%= f.submit t("Upload"), :html => {:class => "register"}%>
					</div>
					<% end %>
					<%if session[:language] = "vi"%>
						<strong class="changepass"><a href="<%= managerusers_path %>?lang=vi" class = "changepass"><%= t :back %></a></strong>
					<%else%>
						<strong class="changepass"><a href="<%= managerusers_path %>" class = "changepass"><%= t :back %></a></strong>
					<%end%>
			</div>
		</div>
		<script type="text/javascript">
			function checkUploadExelFile() {
				var file = document.getElementById("manageruser_excel_file")
				var fileName = file.value;
				// if (fileName.length<1)
				// alert("Please chose your file");
				// else
				// {
				var ext = fileName.substring(fileName.lastIndexOf('.') + 1);
				if (ext == "xls" || ext == "XLS" || ext == "xlsx" || ext == "XLSX") {
					return true;
				} else {
					alert("<%= t("uploadfail")%>");
					return false;
				}
				// }
			}
		</script>
	</body>
</html>
